package ar.pmt.vista.acciones;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import ar.pmt.vista.beans.Usuario;
import ar.pmt.vista.utils.Constants;
import ar.pmt.vista.utils.Utils;

/**
 * @author gburgener
 */
public class ReanudarAction extends Action {

    /**
     * @param mapping ActionMapping
     * @param form ActionForm
     * @param request HttpServletRequest
     * @param response HttpServletResponse
     * @return ActionForward
     * @throws Exception control general de errores de la aplicacion
     */
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
       ActionForward forward = null;



       // Obtengo el Usuario de session
       Usuario usuario = Utils.obtenerUsuario(request);

       if (usuario == null) {
          // Login
          forward = mapping.findForward(Constants.LOGIN_KEY);
       } else {
          // Procesos Existentes
          forward = mapping.findForward(Constants.SUCCESS_KEY);
       }

        return forward;
    }


}